//
//  SISSNetworkingManager+Mine.m
//  SISSAPP
//
//  Created by 优房网 on 2017/5/4.
//  Copyright © 2017年 优房网. All rights reserved.
//

#import "SISSNetworkingManager+Mine.h"




@implementation SISSNetworkingManager (Mine)

// 6.2.1 删除线下房源
- (void)deleteHouseResourceWithHouseId:(NSString *)houseId successBlock:(void (^)(id))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"id":houseId
                                 };
    
    [kNetworkManager GETWithURLString:URL_DELETE_HOUSE parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.2.1 删除线下房源: responseObject-->%@",responseObject);
        
        if (successBlock) {
            successBlock(responseObject);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.2.2 删除已登记客源信息
- (void)deletePassengerResourceWithPassengerId:(NSString *)passengerId successBlock:(void (^)(id))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"id":passengerId
                                 };
    
    [kNetworkManager GETWithURLString:URL_DELETE_PASSENGER parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.2.2 删除已登记客源信息: responseObject-->%@",responseObject);
        
        if (successBlock) {
            successBlock(responseObject);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.3.1 获取我登记的线下房源  GET请求
- (void)requestOfflineHouseWithsuccess:(void (^)(NSArray<SISSHouseResourceModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_OFFLINE_HOUSE parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.3.1 获取我登记的线下房源: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *houseResourceArr = [NSArray yy_modelArrayWithClass:[SISSHouseResourceModel class] json:dataArr];
        if (successBlock) {
            successBlock(houseResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.3.2 获取我登记的线下客源  GET请求
- (void)requestOfflinePassengerWithsuccess:(void (^)(NSArray<SISSPassengerResourceModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_OFFLINE_PASSENGER parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.3.2 获取我登记的线下客源: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *houseResourceArr = [NSArray yy_modelArrayWithClass:[SISSPassengerResourceModel class] json:dataArr];
        if (successBlock) {
            successBlock(houseResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.4.1 获取房源详情  GET请求
- (void)requestHouseResourceDetailWithHouseId:(NSString *)houseId successBlock:(void (^)(SISSHouseResourceModel *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"ahrId":houseId
                                 };
    
    [kNetworkManager GETWithURLString:URL_HOUSE_DETAIL parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.4.1 获取房源详情: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *houseDetailArr = [NSArray yy_modelArrayWithClass:[SISSHouseResourceModel class] json:dataArr];
        
        if (successBlock) {
            successBlock(houseDetailArr.firstObject);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];

}

// 6.4.2 获取客源详情  GET请求
- (void)requestPassengerResourceDetailWithPassengerId:(NSString *)passengerId successBlock:(void (^)(SISSPassengerResourceModel *passengerModel))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"abdId":passengerId
                                 };
    
    [kNetworkManager GETWithURLString:URL_PASSENGER_DETAIL parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.4.2 获取客源详情: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *passengerDetailArr = [NSArray yy_modelArrayWithClass:[SISSPassengerResourceModel class] json:dataArr];
        
        if (successBlock) {
            successBlock(passengerDetailArr.firstObject);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];

}

//  6.5.1 获取我的推荐-房源 GET请求
- (void)requestMyRecommendHouseWithsuccess:(void (^)(NSArray<SISSHouseResourceModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_MY_RECOMMEND_HOUSE parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.5.1 获取我的推荐-房源: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *houseResourceArr = [NSArray yy_modelArrayWithClass:[SISSHouseResourceModel class] json:dataArr];
        if (successBlock) {
            successBlock(houseResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.5.2 获取我的推荐-客源 GET请求
- (void)requestMyRecommendPassengerWithsuccess:(void (^)(NSArray<SISSPassengerResourceModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_MY_RECOMMEND_PASSENGER parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.5.2 获取我的推荐-客源: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *passengerResourceArr = [NSArray yy_modelArrayWithClass:[SISSPassengerResourceModel class] json:dataArr];
        if (successBlock) {
            successBlock(passengerResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}


// 6.14.1  获取经纪人信息 GET请求
- (void)requestPersonInfoWithSpId:(NSString *)spId success:(void (^)(SISSPersonInfoModel *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"spId":spId
                                 };
    // 获得文件路径
    NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    NSString *filePath = [documentPath stringByAppendingPathComponent:@"personInfo.archiver"];
    [kNetworkManager GETWithURLString:URL_GET_PERSONAL_USER_INFO parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.14.1  获取经纪人信息: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSDictionary *dataDict = responseObject[@"data"];
        // 归档（序列化）
        [NSKeyedArchiver archiveRootObject: dataDict toFile:filePath];
        SISSPersonInfoModel *personInfo = [SISSPersonInfoModel yy_modelWithJSON:dataDict];
        if (successBlock) {
            successBlock(personInfo);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
            NSLog(@"%@",error);
        }
        //解归档（反序列化）
        NSDictionary *dataDict = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath];
        if (!dataDict) return;
        SISSPersonInfoModel *personInfo = [SISSPersonInfoModel yy_modelWithJSON:dataDict];
        if (successBlock) {
            successBlock(personInfo);
        }
    }];
}


// 6.15.1  获取房源进度历史业务 GET请求
- (void)requestHouseProgressHistoryWithsuccess:(void (^)(NSArray<SISSHouseProgressModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_HOUSE_PROGRESS_HISTORY parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.15.1  获取房源进度历史业务 GET请求: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SISSHouseProgressModel class] json:dataArr];
        if (successBlock) {
            successBlock(modelArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.15.2  获取客源进度历史业务 GET请求
- (void)requestPassengerProgressHistoryWithsuccess:(void (^)(NSArray<SISSPassengerProgressModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_PASSENGER_PROGRESS_HISTORY parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.15.2  获取客源进度历史业务 GET请求: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SISSPassengerProgressModel class] json:dataArr];
        if (successBlock) {
            successBlock(modelArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}


// 6.15.3  获取房源合作历史业务 GET请求
- (void)requestHouseCooperationHistoryWithsuccess:(void (^)(NSArray<SISSHouseCoopProgressModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_HOUSE_COOPERATION_PROGRESS_HISTORY parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.15.3  获取房源合作历史业务: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SISSHouseCoopProgressModel class] json:dataArr];
        if (successBlock) {
            successBlock(modelArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.15.4  获取客源合作历史业务 GET请求
- (void)requestPassengerCooperationHistoryWithsuccess:(void (^)(NSArray<SISSPassengerCoopProgressModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_PASSENGER_COOPERATION_PROGRESS_HISTORY parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.15.4  获取客源合作历史业务: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SISSPassengerCoopProgressModel class] json:dataArr];
        if (successBlock) {
            successBlock(modelArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.16 获取经纪人收到的合作请求数 GET请求
- (void)requestCooperationRequestCountyWithsuccess:(void (^)(NSInteger))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_COOPERATION_REQUEST_COUNT parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.16 获取经纪人收到的合作请求数: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        if (successBlock) {
            successBlock([responseObject[@"data"] integerValue]);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.17 根据身份证号获取黑名单信息
- (void)requestBackListWithIdNO:(NSString *)idNo success:(void (^)(id))successBlock failed:(void (^)(NSError *))failedBlock {
   
    NSDictionary *parameters = @{
                                 @"idNo":idNo
                                 };
    
    [kNetworkManager GETWithURLString:URL_MY_BLACK_LIST parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.17 根据身份证号获取黑名单信息: responseObject-->%@",responseObject);

        if (successBlock) {
            successBlock(responseObject);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

#pragma mark - 2.0
// 6.2.3 删除线下登记的出租
- (void)deleteLeaseOfflineWithLeaseId:(NSString *)leaseId successBlock:(void (^)(id))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"id":leaseId
                                 };
    
    [kNetworkManager GETWithURLString:URL_DELETE_RENTOUT_OFFLINE parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.2.3 删除线下登记的出租: responseObject-->%@",responseObject);
        
        if (successBlock) {
            successBlock(responseObject);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.2.4 删除线下登记的租客
- (void)deleteTenantOfflineWithTenantId:(NSString *)tenantId successBlock:(void (^)(id))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"id":tenantId
                                 };
    
    [kNetworkManager GETWithURLString:URL_DELETE_TENANT_OFFLINE parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.2.4 删除线下登记的租客: responseObject-->%@",responseObject);
        
        if (successBlock) {
            successBlock(responseObject);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}


// 6.3.3 获取登记的线下出租  GET请求
- (void)requestOfflineRentOutWithsuccess:(void (^)(NSArray<SISSRentOutModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_OFFLINE_LEASE parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.3.3 获取登记的线下出租  GET请求: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *rentOutResourceArr = [NSArray yy_modelArrayWithClass:[SISSRentOutModel class] json:dataArr];
        if (successBlock) {
            successBlock(rentOutResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.3.4 获取登记的线下租客 GET请求
- (void)requestOfflineTenantWithsuccess:(void (^)(NSArray<SISSTenantModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_OFFLINE_TENANT parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.3.4 获取登记的线下租客  GET请求: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *tenantResourceArr = [NSArray yy_modelArrayWithClass:[SISSTenantModel class] json:dataArr];
        if (successBlock) {
            successBlock(tenantResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.5.3 获取我的推荐-出租 获取经纪人推荐的目标出租 GET请求
- (void)requestMyRecommendRentOutWithsuccess:(void (^)(NSArray<SISSRentOutModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_MY_RECOMMEND_RENTOUT parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.5.3 获取我的推荐-出租 获取经纪人推荐的目标出租: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *rentOutResourceArr = [NSArray yy_modelArrayWithClass:[SISSRentOutModel class] json:dataArr];
        if (successBlock) {
            successBlock(rentOutResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.5.4 获取我的推荐-租客 获取经纪人推荐的目标租客 GET请求
- (void)requestMyRecommendTenantWithsuccess:(void (^)(NSArray<SISSTenantModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_MY_RECOMMEND_TENANT parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.5.4 获取我的推荐-租客 获取经纪人推荐的目标租客: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *tenantResourceArr = [NSArray yy_modelArrayWithClass:[SISSTenantModel class] json:dataArr];
        if (successBlock) {
            successBlock(tenantResourceArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.15.5  获取出租进度历史业务 GET请求
- (void)requestRentOutProgressHistoryWithsuccess:(void (^)(NSArray<SISSRentOutProgressModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_RENTOUT_PROGRESS_HISTORY parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.15.5  获取出租进度历史业务: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SISSRentOutProgressModel class] json:dataArr];
        if (successBlock) {
            successBlock(modelArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.15.6  获取求租进度历史业务 GET请求
- (void)requestTenantProgressHistoryWithsuccess:(void (^)(NSArray<SISSTenantProgressModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    NSDictionary *parameters = @{
                                 @"spId":[SISSUserAccount shared].spId
                                 };
    
    [kNetworkManager GETWithURLString:URL_TENANT_PROGRESS_HISTORY parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.15.6  获取求租进度历史业务: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SISSTenantProgressModel class] json:dataArr];
        if (successBlock) {
            successBlock(modelArr);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.18.1 获取业绩指标 GET请求
- (void)requestAchievementListWithSuccessBlock:(void (^)(NSArray<SISSKPIListModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    NSDictionary *parameters = @{@"spId":[SISSUserAccount shared].spId};
    
    [kNetworkManager GETWithURLString:URL_ACHIEVEMENT_LIST parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.18.1 获取业绩指标 GET请求: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SISSKPIListModel class] json:dataArr];
        if (successBlock) {
            successBlock(modelArr);
        }
        
    } failure:^(NSError *error) {
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.1.15  获取钱包信息 GET请求
- (void)requestPersonCenterWalletInfoWithSuccessBlock:(void (^)(SISSWalletInfoModel *))successBlock failed:(void (^)(NSError *))failedBlock {

    NSDictionary *parameters = @{
                                 @"saId":[SISSUserAccount shared].saId
                                 };
    
    [kNetworkManager GETWithURLString:URL_GET_PERSON_CENTER_WALLET_INFO parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.1.15  获取钱包信息 GET请求: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        
        NSDictionary *dataDict = responseObject[@"data"];
        
        SISSWalletInfoModel *baseModel = [SISSWalletInfoModel yy_modelWithJSON:dataDict];
        if (successBlock) {
            successBlock(baseModel);
        }
        
    } failure:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 6.1.16  经纪人获取收支明细 GET请求
- (void)requestPersonCenterWalletIncomeDetailInfoWithPageNo:(NSInteger)pageNo successBlock:(void (^)(SISSBasePagingModel *))successBlock failed:(void (^)(NSError *))failedBlock {
    NSInteger pageSize = 20;
    NSDictionary *parameters = @{
                                 @"saId":[SISSUserAccount shared].saId,
                                 @"pageNo":@(pageNo),
                                 @"pageSize":@(pageSize)
                                 };
    
    [kNetworkManager GETWithURLString:URL_GET_PERSON_CENTER_WALLET_INCOME_DETAIL_INFO parameters:parameters success:^(id responseObject) {
        
        NSLog(@"6.1.16  经纪人获取收支明细 GET请求: responseObject-->%@",responseObject);
        
        if ([responseObject[@"code"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
        }
        NSDictionary *dataDict = responseObject[@"data"];
        
        SISSBasePagingModel *baseModel = [SISSBasePagingModel yy_modelWithJSON:dataDict];
        if (successBlock) {
            successBlock(baseModel);
        }
        
    } failure:^(NSError *error) {
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

@end
